<script src="${rc.getContextPath()}/manage/js/dwzCustomJs/dwz.custom.advancedquery.js?v=${ver}" type="text/javascript"></script>
<#include "/common/pagerForm.html">
<form rel="pagerForm" method="post" action="" class="required-validate" onsubmit="return navTabSearch(this)">
	<input type="hidden" id="advancedStatus" name="advancedStatus" value="${condition.advancedStatus!''}" />
	<div class="pageHeader">
		<div class="searchBar">
			<ul class="searchContent">
				<li><label><@label key='requirementNum.C,colon'>需求编号：</@label></label> <input type="text" name="requirementNum" value="${condition.requirementNum!''}" /></li>
				<li><label><@label key='materialCode.C,colon'>物料编号：</@label></label> <input type="text" name="materialCode" value="${condition.materialCode!''}" /></li>
				<li><label><@label key='RequirementStatusECode.C,colon'>物料需求状态：</@label></label> <select name="statusECode">
						<option value=""><@label key='all.C'>所有</@label></option> <#if StatusECode??> <#list StatusECode as ecode>
						<option value="${ecode.eCode!''}"<#if condition.statusECode?? && condition.statusECode == ecode.eCode> selected</#if> >${ecode.eCodeText!''}</option> </#list> </#if>
				</select></li>
			</ul>
			<ul class="searchContent">
				<li><label><@label key='productionOrderNum.C,colon'>生产订单编号：</@label></label> <input type="text" name="productionOrderNum" value="${condition.productionOrderNum!''}" /></li>
				<li><label><@label key='productionControlNum.C,colon'>生产管理号：</@label></label> <input type="text" name="productionControlNum" value="${condition.productionControlNum!''}" /></li>

				<li><label><@label key='distributionTimeoutFlag.C,colon'>配送超时：</@label></label> <select name="distributionTimeoutFlag">
						<option value=""><@label key='all.C'>所有</@label></option>
						<option value="0"<#if condition.distributionTimeoutFlag?? && condition.distributionTimeoutFlag==0> selected="selected"</#if>><@label key="no.C">否</@label></option>
						<option value="1"<#if condition.distributionTimeoutFlag?? && condition.distributionTimeoutFlag==1> selected="selected"</#if>><@label key="yes.C">是</@label></option>
				</select></li>
				<li class="query">
					<div class="buttonActive">
						<div class="buttonContent">
							<button type="submit"><@label key="query.B">查询</@label></button>
						</div>
					</div>
				</li>
				<li class="advancedQuery"><a id="advancedQuery" href="javascript:void(0);" onclick="openAdvanced(navTab.getCurrentPanel())"> <@label key="advancedQuery.C">高级查询</@label> </a> <span onclick="openAdvanced(navTab.getCurrentPanel());"></span></li>
			</ul>
		</div>
	</div>

	<div id="collapsablePanel" style="display: none;" class="pageHeader">
		<div class="searchBar">
			<ul class="searchContent">

				<li><label><@label key='workCenterCode.C,colon'>工作中心编号：</@label></label> <input type="text" name="workcenterCode" value="${condition.workcenterCode!''}" /></li>
				<li><label style="width: 120px;"><@label key='workUnitCode.C,colon'>作业单元编号：</@label></label> <input type="text" name="workunitCode" value="${condition.workunitCode!''}" /></li>
				<li><label><@label key='WarehouseCode.C,colon'>仓库编号：</@label></label> <input type="text" name="warehouseCode" value="${condition.warehouseCode!''}" /></li>
				<li><label><@label key='storageLocationCode.C,colon'>库位编号：</@label></label> <input type="text" name="storageLocationCode" value="${condition.storageLocationCode!''}" /></li>
			</ul>

			<ul class="searchContent">
				<li><label><@label key='createDateTime.C,colon'>创建日期从：</@label></label> <input type="text" class="date" readonly="readonly" size="17" max_Date="{maxCreateDateTime}" name="minCreateDateTime" value="${condition.minCreateDateTime!''}" /> <a class="inputDateButton" href="javascript:;">选择</a></li>
				<li><label style="width: 120px;"><@label key="to.C,colon">至：</@label></label> <input type="text" class="date" readonly="readonly" size="17" min_Date="{minCreateDateTime}" name="maxCreateDateTime" value="${condition.maxCreateDateTime!''}" /> <a class="inputDateButton" href="javascript:;">选择</a></li>
				<li><label><@label key='createUser.C,colon'>创建人：</@label></label> <input type="text" name="createUser" value="${condition.createUser!''}" /></li>
				<li><label><@label key='processOperationId.C,colon'>工艺工序ID：</@label></label> <input type="text" name="processOperationId" class="digits" value="${condition.processOperationId!''}" /></li>

			</ul>
			<ul class="searchContent">
				<li><label><@label key='closeDateTime.C,colon'>需求关闭时间：</@label></label> <input type="text" class="date" readonly="readonly" size="17" max_Date="{maxCloseDateTime}" name="minCloseDateTime" value="${condition.minCloseDateTime!''}" /> <a class="inputDateButton" href="javascript:;">选择</a></li>
				<li><label style="width: 120px;"><@label key="to.C,colon">至：</@label></label> <input type="text" class="date" readonly="readonly" size="17" min_Date="{minCloseDateTime}" name="maxCloseDateTime" value="${condition.maxCloseDateTime!''}" /> <a class="inputDateButton" href="javascript:;">选择</a></li>
				<li><label><@label key='closeUser.C,colon'>关闭人：</@label></label> <input type="text" name="closeUser" value="${condition.closeUser!''}" /></li>
			</ul>
			<ul class="searchContent">
				<li><label><@label key='expectedArrivalDateTime.C,colon'>期望到货时间：</@label></label> <input type="text" class="date" readonly="readonly" size="17" max_Date="{maxExpectedArrivalDateTime}" name="minExpectedArrivalDateTime" value="${condition.minExpectedArrivalDateTime!''}" /> <a class="inputDateButton" href="javascript:;">选择</a></li>
				<li><label style="width: 120px;"><@label key="to.C,colon">至：</@label></label> <input type="text" class="date" readonly="readonly" size="17" min_Date="{minExpectedArrivalDateTime}" name="maxExpectedArrivalDateTime" value="${condition.maxExpectedArrivalDateTime!''}" /> <a class="inputDateButton" href="javascript:;">选择</a></li>
				<li><label><@label key='distributionModeCode.C,colon'>配送方式编号：</@label></label> <input type="text" name="distributionModeCode" value="${condition.distributionModeCode!''}" /></li>
				<li><label><@label key='distributionUser.C,colon'>配送人：</@label></label> <input type="text" name="distributionUser" value="${condition.distributionUser!''}" /></li>
			</ul>
			<ul class="searchContent">
				<li><label><@label key='pullStrategyCode.C,colon'>拉动策略编号：</@label></label> <input type="text" name="pullStrategyCode" value="${condition.pullStrategyCode!''}" /></li>
				<li><label style="width: 120px;"><@label key='requirementTriggerModeCode.C,colon'>物料需求触发策略编号：</@label></label> <input type="text" name="requirementTriggerModeCode" value="${condition.requirementTriggerModeCode!''}" /></li>
				<li><label><@label key='distributionTriggerModeCode.C,colon'>配送触发策略编号：</@label></label> <input type="text" name="distributionTriggerModeCode" value="${condition.distributionTriggerModeCode!''}" /></li>
				<li><label><@label key='distributionCode.C,colon'>配送编号：</@label></label> <input type="text" name="distributionCode" value="${condition.distributionCode!''}" /></li>
			</ul>
		</div>
	</div>
</form>

<div class="pageContent">

	<div class="panelBar">
		<ul class="toolBar">

			<@buttonRight menuCode="CANCELSTATUSECODE" labelKey="edit.B" defalutName="取消需求">
			<li><a class="edit" target="selectedTodo" href="${rc.getContextPath()}/manage/requirement/cancelStatusECode?navTabId=${navTabId!''}" postType="string" rel="codes" callback="batchjobAjaxDone" title="<@label key='cancelDistribution.D'>确认取消配送需求？</@label>"> <span><@label key="cancelStatusECode.B">取消需求</@label></span></a></li></@buttonRight> <@buttonRight menuCode="VIEWREQUIREMENT" labelKey="view.B" defalutName="详情">
			<li><a class="icon" target="dialog" mask="true" width="960" height="550" rel="codes" href="${rc.getContextPath()}/manage/requirement/viewRequirement?requirementNum={requirements}&navTabId=${navTabId!''}"><span><@label key="view.B">详情</@label></span></a></li></@buttonRight>


		</ul>
	</div>
	<table class="table" width="200%" layoutH="160">
		<thead>
			<tr>
				<th width="22"><input type="checkbox" group="codes" class="checkboxCtrl"></th>
				<th width="80"><@label key="requirementNum.C">需求编号</@label></th>
				<th width="100" orderField="materialCode"><@label key='materialCode.C'>物料编号</@label></th>
				<th width="100"><@label key='materialText.C'>物料名称</@label></th>
				<th width="100"><@label key='materialspec.C'>物料规格</@label></th>
				<th width="100"><@label key='requirementQuantity.C'>需求数量</@label></th>
				<th width="100"><@label key='distributiveQuantity.C'>配送数量</@label></th>
				<th width="120" orderField="createDateTime"<#if (page.orderField?? && page.orderField == 'createDate')>class="${page.orderDirection!''}"</#if>> <@label key='createDateTime.C'>创建时间</@label></th>
				<th width="80" orderField="expectedArrivalDateTime"><@label key='expectedArrivalDateTime.C'>期望到货时间</@label></th>
				<th width="80" orderField="closeDateTime"><@label key='closeDateTime.C'>需求关闭时间</@label></th>
				<th width="100"><@label key='requirementTriggerModeText.C'>需求触发策略</@label></th>
				<th width="80"><@label key='RequirementStatusECode.C'>需求状态</@label></th>
				<th width="80"><@label key='productionOrder.C'>生产订单</@label></th>
				<th width="100"><@label key='productionControlNum.C'>生产管理号</@label></th>
				<th width="80"><@label key='workCenterCode.C'>工作中心</@label></th>
				<th width="140"><@label key='workUnitCode.C'>作业单元</@label></th>
				<th width="140"><@label key='WarehouseCode.C'>仓库编号</@label></th>
				<th width="80"><@label key='storageLocationCode.C'>库位编号</@label></th>
				<th width="80"><@label key='pullStrategyText.C'>拉动策略</@label></th>
				<th width="80"><@label key='distributionTriggerModeText.C'>配送触发策略</@label></th>
				<th width="100"><@label key='distributionModeText.C'>配送方式描述</@label></th>
				<th width="100"><@label key='distributionUser.C'>配送人</@label></th>
				<th width="80"><@label key='distributionTimeoutFlag.C'>配送超时</@label></th>
				<th width="100"><@label key='processOperationId.C'>工艺工序ID</@label></th>
				<th width="80"><@label key='createUser.C'>创建人</@label></th>
				<th width="80"><@label key='modifyUser.C'>修改人</@label></th>
				<th width="140"><@label key='modifyDateTime.C'>修改时间</@label></th>
			</tr>
		</thead>
		<tbody>
			<#if page??><#if (page.data?size>0)> <#list page.data as requirement>
			<tr target="requirements" rel="${requirement.requirementNum!''}">
				<td><input name="codes" value="${requirement.requirementNum!''}" type="checkbox"></td>
				<td>${requirement.requirementNum!''}</td>
				<td>${requirement.materialCode!''}</td>
				<td>${requirement.materialText!''}</td>
				<td>${requirement.materialSpec!''}</td>
				<td>${requirement.requirementQuantity!''}</td>
				<td>${requirement.actualQuantity!''}</td>
				<td>${(requirement.createDateTime?string("yyyy-MM-dd HH:mm:ss"))?if_exists}</td>
				<td>${(requirement.expectedArrivalDateTime?string("yyyy-MM-dd HH:mm:ss"))?if_exists}</td>
				<td>${(requirement.closeDateTime?string("yyyy-MM-dd HH:mm:ss"))?if_exists}</td>
				<td>${requirement.requirementTriggerModeText!''}</td>
				<td><#if StatusECode??> <#list StatusECode as ecode> <#if requirement.statusECode == ecode.eCode>${ecode.eCodeText!''}<#break></#if> </#list> </#if></td>
				<td>${requirement.productionOrderNum!''}</td>
				<td>${requirement.productionControlNum!''}</td>
				<td>${requirement.workcenterCode!''}</td>
				<td>${requirement.workunitCode!''}</td>
				<td>${requirement.warehouseCode!''}</td>
				<td>${requirement.storageLocationCode!''}</td>
				<td>${requirement.pullStrategyText!''}</td>
				<td>${requirement.distributionTriggerModeText!''}</td>
				<td>${requirement.distributionModeText!''}</td>
				<td>${requirement.distributionUser!''}</td>
				<td><#if requirement.distributionTimeoutFlag==0> <@label key="no.C">否</@label> <#else><@label key="yes.C">是</@label></#if></td>
				<td>${requirement.processOperationId!''}</td>
				<td>${requirement.createUser!''}</td>
				<td>${requirement.modifyUser!''}</td>
				<td>${(requirement.modifyDateTime?string("yyyy-MM-dd HH:mm:ss"))?if_exists}</td>
			</tr>
			</#list> <#else>
			<tr target="product_id">
				<td colspan="20" class="noData">======<@label key='noListData.C'>列表无数据</@label>=====</font></td>
			</tr>
			</#if> <#else>
			<tr target="product_id">
				<td colspan="20" class="noData">======<@label key='noListData.C'>列表无数据</@label>=====</font></td>
			</tr>
			</#if>
		</tbody>
	</table>
	<#include "/common/panelBar.html">
</div>

<script>
	$(function() {
		initAdvancedQuery(navTab.getCurrentPanel());
	});
</script>